#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

struct Song {
    int id;
    ll h;
};

void solve(){
    int n, m, a, b;
    cin >> n >> m >> a >> b;

    int h[105][100005];
    for (int i = 0; i < a; i++) {
        for (int j = 0; j < n; j++) {
            cin >> h[i][j];
        }
    }

    Song s[100005];
    for (int j = 0; j < n; j++) {
        ll sum = 0;
        for (int i = 0; i < a; ++i) {
            if (i + 1 != b) {
                sum += h[i][j];
            }
        }
        s[j] = {j + 1, sum};
    }

    sort(s, s + n, [](const Song& x, const Song& y) {
        return x.h > y.h;
    });

    int pl[100005];
    for (int i = 0; i < m; i++) {
        pl[i] = s[i].id;
    }

    int fav = 1;
    int mx = h[b - 1][0];
    for (int j = 1; j < n; j++) {
        if (h[b - 1][j] > mx) {
            mx = h[b - 1][j];
            fav = j + 1;
        }
    }

    int pos = -1;
    for(int i = 0; i < m; i++){
        if(pl[i] == fav){
            pos = i;
            break;
        }
    }

    if (pos != -1) {
        int val = pl[pos];
        for (int i = pos; i > 0; i--) {
            pl[i] = pl[i - 1];
        }
        pl[0] = val;
    } else {
        pl[m - 1] = fav;
    }

    for (int i = 0; i < m; i++) {
        if (i > 0) {
            cout << " ";
        }
        cout << pl[i];
    }
    cout << endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}